package com.shievy.anweb.webview.web.chrome

import android.webkit.ConsoleMessage
import android.webkit.WebChromeClient
import android.webkit.WebView
import com.shievy.anweb.base.uitl.LogUtil
import com.shievy.anweb.webview.web.callback.WebViewCallBack

/**
 * 定义浏览器内核
 * */

class XWebChromeClient(var mCallBack: WebViewCallBack) : WebChromeClient() {
    override fun onReceivedTitle(view: WebView?, title: String?) {
        super.onReceivedTitle(view, title)
        mCallBack.onChangeTitle(title)
    }

    override fun onConsoleMessage(consoleMessage: ConsoleMessage?): Boolean {
        LogUtil.d("WebView message ==>> ",consoleMessage?.message())
        return super.onConsoleMessage(consoleMessage)
    }
}